$(function () {

    $(".colse").click(function () {
        $(this).prev().prev().hide();
        $(this).prev().hide();
        $(this).hide();
    });

  addItem();
});
function addItem() {
    /**
     * 显示新增选项
     */
    var type= $(".titleTypes").text();
    var Item =["A","B","C","D"];
    var Option=["A","B","C","D","E","F","G","H","I","G"];
        if (type=="单选"){
            for (var i =0 ;i< 4;i++){
            $("#Item").append("<li><input type='hidden' readonly  name='fileOptions["+i+"].optionsLetter' value="+Item[i]+" style='border:none' ></li>" +
                "<li>"+Item[i]+":<input type='text' name='fileOptions["+i+"].optionsContent'><button class='layui-btn-xs layui-btn layui-btn-radius colse'>关闭该选项</button></li>");
            }
            $("#addItem").hide();
        }else {
            for (var i=0;i<4;i++){
            $("#Item").append("<li>选项值：<input type='text'  name='fileOptions["+i+"].optionsLetter' value="+Option[i]+" ></li>" +
                "<li>内容:<input type='text' name='fileOptions["+i+"].optionsContent'></li>");
                 }
            }


}